package sm;

import org.hyperic.sigar.SigarException;

public class SMMemory  extends Basic{
    private long M=1024*1024 ;
    private long G=1024*1024*1024 ;
    public long getSystemFreeMemory() throws SigarException{
        return sigar.getMem().getFree() / M;
    }
    public long getSystemUsedMemory() throws SigarException{
        return sigar.getMem().getUsed() / M;
    }
    public long getPidVMMemory(long pid) throws SigarException{
        return sigar.getProcMem(pid).getSize() / M;
    }
    public long getPidMemory(long pid) throws SigarException{
        return sigar.getProcMem(pid).getResident() / M;
    }
}
